package cloud.keveri.chat4j.api;

import cloud.keveri.chat4j.api.entity.chat.CompletionRequest;
import cloud.keveri.chat4j.api.entity.image.ImageRequest;
import okhttp3.sse.EventSource;
import okhttp3.sse.EventSourceListener;

/**
 * AI 服务提供者
 * <p>
 * 作者：沈自在
 **/
public interface ChatBlender {

    /**
     * 文本问答
     */
    Response completions(CompletionRequest request);

    /**
     * 文本问答、选择地址
     */
    Response completions(String host, String key, CompletionRequest request);

    /**
     * 流式问答
     */
    EventSource completions(CompletionRequest request, EventSourceListener listener);

    /**
     * 流式问答、选择地址
     */
    EventSource completions(String host, String key, CompletionRequest request, EventSourceListener listener);

    /**
     * 图片生成
     */
    default Response generateImage(ImageRequest request) {
        return generateImage(null, null, null);
    }

    /**
     * 图片生成、选择地址
     */
    default Response generateImage(String host, String key, ImageRequest request) {
        System.out.println("[Ai-Chat] 该模型暂未实现该方法");
        return null;
    }

}
